package kshell.cn.msg.controller;

import kshell.cn.msg.service.ProducerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class IndexController {
    @Resource
    private  ProducerService producerService;

    @GetMapping("/send")
    public void sendMessage(@RequestParam(value = "msg", defaultValue = "kshell") String message) {
        producerService.send(message);
    }
}
